<template>
	<view>
		<NineGrid :list="list" @goLeave="change"></NineGrid>
	</view>
</template>

<script>
	import NineGrid from '@/components/9grid/NineGrid'
	import {doNavigatePage} from '@/js/navigatePage'
	import {BaseScrollUrl} from '@/js/constant'
	export default {
		components:{NineGrid},
		data() {
			return {
				title: 'Hello',
				description:'uView是uni-app生态专用的UI框架',
				closable:true,
				list: [{
					name: 'photo',
					title: '基础功能',
					inward: true,
					src:'/static/img/qingjia.png',
					url: BaseScrollUrl
				},
				{
					name: 'photo',
					title: '测试',
					inward: false,
					src:'/static/img/qingjia.png',
					url: BaseScrollUrl
				},
				],
			}
		},
		onPullDownRefresh(){
			console.log('refresh');
			setTimeout(function () {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		onLoad() {

		},
		updated() {
			console.log('首页 updated');
		},
		methods: {
			change(index){
				let obj = this.list[index];
				doNavigatePage(obj.url)
			}
		}
	}
</script>

<style lang="scss">
	.text {
		font-size: 14px;
		margin-top: 5px;
	}

	.example-body {
		/* #ifndef APP-NVUE */
		// display: block;
		/* #endif */
	}

	.grid-dynamic-box {
		margin-bottom: 15px;
	}

	.grid-item-box {
		flex: 1;
		// position: relative;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
	}

	.grid-item-box-row {
		flex: 1;
		// position: relative;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
	}

	.grid-dot {
		position: absolute;
		top: 5px;
		right: 15px;
	}

	.swiper {
		height: 420px;
	}

	/* #ifdef H5 */
	@media screen and (min-width: 768px) and (max-width: 1425px) {
		.swiper {
			height: 630px;
		}
	}

	@media screen and (min-width: 1425px) {
		.swiper {
			height: 830px;
		}
	}

	/* #endif */
</style>
